package org.admanager.scamapping.plugin.scamapping.diagram.edit.policies;

import org.admanager.scamapping.plugin.scamapping.diagram.edit.commands.ComponentCreateCommand;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.commands.ReferenceCreateCommand;
import org.admanager.scamapping.plugin.scamapping.diagram.edit.commands.ServiceCreateCommand;
import org.admanager.scamapping.plugin.scamapping.diagram.providers.MappingElementTypes;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;

/**
 * @generated
 */
public class CompositeCompositeCompartmentItemSemanticEditPolicy extends
		MappingBaseItemSemanticEditPolicy {

	/**
	 * @generated
	 */
	public CompositeCompositeCompartmentItemSemanticEditPolicy() {
		super(MappingElementTypes.Composite_3001);
	}

	/**
	 * @generated
	 */
	protected Command getCreateCommand(CreateElementRequest req) {
		if (MappingElementTypes.Component_3002 == req.getElementType()) {
			return getGEFWrapper(new ComponentCreateCommand(req));
		}
		if (MappingElementTypes.Service_3005 == req.getElementType()) {
			return getGEFWrapper(new ServiceCreateCommand(req));
		}
		if (MappingElementTypes.Reference_3006 == req.getElementType()) {
			return getGEFWrapper(new ReferenceCreateCommand(req));
		}
		return super.getCreateCommand(req);
	}

}
